#!/usr/bin/env python
#-*-coding:utf-8-*-
import time
import datetime

#返回开始日期和结束日期的时间列表
def getDaysBetweenStartDayAndEndDay(startDay,endDay):
    dateFormatPattern = '%Y-%m-%d'
    startDate = datetime.datetime.strptime(startDay,dateFormatPattern)
    endDate = datetime.datetime.strptime(endDay,dateFormatPattern)
    days = []
    delta = datetime.timedelta(days=1)
    while startDate.strftime('%Y-%m-%d') != endDate.strftime('%Y-%m-%d'):
        days.append(startDate.strftime('%Y-%m-%d'))
        startDate += delta
    days.append(endDate.strftime('%Y-%m-%d'))
    return days

start = "2013-01-01"
end = "2013-03-04"
days = getDaysBetweenStartDayAndEndDay(start,end)
for day in days:
    print (day)